
package org.nelson.msgdispatcher;

import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;

import sun.rmi.runtime.GetThreadPoolAction;

public class Parameter <E> {
	private  String name = "";
	private E value;
	
	
	public static final Parameter<Object> Any = new Parameter<Object>("ANY",null);
	public static final Parameter<Object> Anonymous = new Parameter<Object>("ANONYMOUS",null);
	
	
	public Parameter(String name, E obj) {
		this.name = name;
		this.value = obj;
	}
	
	public E getValue() { return this.value; }
	public Class getType() { return this.value.getClass(); }
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Parameter) {
			Parameter ob = (Parameter)obj;
			if (ob.getName().equals(getName()) && ob.getValue().equals(getValue())) {
				return true;
			}
		}
		return false;
	}
}
